<template>
    <a-modal
      :title="title"
      :width="600"
      :visible="visible"
      :confirmLoading="confirmLoading"
      @ok="handleOk"
      @cancel="handleCancel"
      cancelText="关闭"
    >
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">

        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          prop="orderNo"
          label="订单编号">
          <a-input  type="number" placeholder="请输入" disabled v-model="model.orderNo"/>
        </a-form-model-item>

        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          prop="activityName"
          label="活动名称">
          <a-input placeholder="请输入" disabled v-model="model.activityName"/>
        </a-form-model-item>

        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          prop="price"
          label="积分价格">
          <a-input  type="number" placeholder="请输入" style="width:368px;" disabled v-model="model.price"/>
        </a-form-model-item>

        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          prop="details"
          label="预约信息">
          <a-input placeholder="请输入" v-model="model.details" disabled />
        </a-form-model-item>

        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          prop="orderStatus"
          label="状态">
          <a-input placeholder="请输入" style="width:368px;" disabled v-model="model.orderStatus"/>
        </a-form-model-item>

        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          prop="createTime"
          label="下单时间">
          <a-input placeholder="请输入" style="width:368px;" disabled v-model="model.createTime"/>
        </a-form-model-item>
      </a-form-model>
    </a-spin>
    </a-modal>
</template>

<script>
  // import { saveOrUpdateRenovation} from '@/api/marketingCenter/newmember'
  export default {
    name:'cc',
    components: {},
    data() {
      return {
        title: '',
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
         wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
        },
        confirmLoading: false,
        validatorRules: {
          orderNo: [{ required: true, message: '请输入订单编号' }],
          activityName: [{ required: true, message: '请输入商品名称' }],
          price: [{ required: true, message: '请输入积分价格!' }],
          details: [{ required: true, message: '请输入预约信息!' }],
          orderStatus: [{ required: true, message: '请选择状态!' }],
          createTime: [{ required: true, message: '请选择下单时间!' }],
        },
      }
    },
    created() {
    },
    methods: {
      add() {
        this.edit({})
      },
      edit(record) {
        this.model = Object.assign({}, record)
        this.visible = true
      },
      // 确定
      handleOk() {
        const that = this
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            // that.confirmLoading = true
            // let obj
            // var addObject={
            //   orderNo:this.model.orderNo,
            //   name:this.model.name,
            //   price:this.model.price,
            //   details:this.model.details,
            //   orderStatus:this.model.orderStatus,
            //   createTime:this.model.createTime,
            // }
            // if (this.model.id) {
            //   addObject.id=this.model.id
            // }
            // console.log(this.model);
            // saveOrUpdateRenovation(addObject).then((res) => {
            //   if (res.success) {
            //     that.$message.success(res.msg)
            //     that.$emit('ok')
            //   } else {
            //     that.$message.warning(res.msg)
            //   }
            // }).finally(() => {
            //   that.confirmLoading = false
            that.close()
            // })
          } else {
            return false;
          }
        })
      },
      // 关闭
      handleCancel() {
        this.close()
      },
      close() {
        this.$emit('close')
        this.fileList = []
        this.visible = false
        this.$refs.form.resetFields();
      },
    }
  }
</script>
<style scoped>
.divList{
  border-bottom: 1px solid #ccc;
  padding-left: 34px;
  margin-bottom: 30px;
  position: relative;
}
.bairuidelete{
  position:absolute;
  top: 135px;
  right: 80px;
  width: 20px;
  height: 20px;
}

</style>